<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>字面量定义类和使用</title>
</head>
<body>
    <script>
      //定义类
      let game={
          name:"绝地求生",
          price:98,
          weapon:["AK","M4"],

      //定义方法
        show : function (){
            document.write("卢本伟牛逼！！");
        }
      };

      //使用
      document.write(game.name+","+game.price+","+game.weapon+"<br>");
      game.show();
    </script>
</body>
</html>